<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>init.c</title>
<style type="text/css">
<!--
body.hl	{ background-color:#ffffff; }
pre.hl	{ color:#000000; background-color:#ffffff; font-size:10pt; font-family:'Courier New';}
.hl.num { color:#ff0000; }
.hl.esc { color:#ff22ff; }
.hl.str { color:#ff0000; }
.hl.dstr { color:#ff0000; }
.hl.slc { color:#0000ff; }
.hl.com { color:#0000ff; }
.hl.dir { color:#ff22ff; }
.hl.sym { color:#000000; }
.hl.line { color:#0000ff; }
.hl.mark	{ background-color:#ffffbb;}
.hl.kwa { color:#b26818; }
.hl.kwb { color:#00ff00; }
.hl.kwc { color:#b26818; }
.hl.kwd { color:#000000; }
//-->
</style>
</head>
<body class="hl">
<pre class="hl"><span class="hl com">/*</span>
<span class="hl com"> *  init.c</span>
<span class="hl com"> *  scheme2</span>
<span class="hl com"> *</span>
<span class="hl com"> *  Created by Leo Katzenstein on 5/26/07.</span>
<span class="hl com"> *  Copyright 2007 __MyCompanyName__. All rights reserved.</span>
<span class="hl com"> *</span>
<span class="hl com"> */</span>

<span class="hl dir">#include</span> <span class="hl dstr">&quot;scheme.h&quot;</span><span class="hl dir"></span>

<span class="hl kwb">void</span> <span class="hl kwd">init</span><span class="hl sym">(</span><span class="hl kwb">void</span><span class="hl sym">)</span>
<span class="hl sym">{</span>
  Pair <span class="hl sym">*</span>p<span class="hl sym">;</span>

  <span class="hl com">/* special symbols */</span>
  define <span class="hl sym">=</span> <span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;define&quot;</span><span class="hl sym">);</span>
  lambda <span class="hl sym">=</span> <span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;lambda&quot;</span><span class="hl sym">);</span>
  quote <span class="hl sym">=</span> <span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;quote&quot;</span><span class="hl sym">);</span>
  cond <span class="hl sym">=</span> <span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;cond&quot;</span><span class="hl sym">);</span>
  nil <span class="hl sym">=</span> <span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;nil&quot;</span><span class="hl sym">);</span>

  t <span class="hl sym">=</span> <span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;t&quot;</span><span class="hl sym">);</span>
  p <span class="hl sym">=</span> <span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">cons</span><span class="hl sym">(</span>t<span class="hl sym">,</span> t<span class="hl sym">),</span> NULL<span class="hl sym">);</span>
  p <span class="hl sym">=</span> <span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;exit&quot;</span><span class="hl sym">),</span> <span class="hl kwd">make_func</span><span class="hl sym">(</span>fexit<span class="hl sym">)),</span> p<span class="hl sym">);</span>
  p <span class="hl sym">=</span> <span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;/&quot;</span><span class="hl sym">),</span> <span class="hl kwd">make_func</span><span class="hl sym">(</span>fdiv<span class="hl sym">)),</span> p<span class="hl sym">);</span>
  p <span class="hl sym">=</span> <span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;*&quot;</span><span class="hl sym">),</span> <span class="hl kwd">make_func</span><span class="hl sym">(</span>fprod<span class="hl sym">)),</span> p<span class="hl sym">);</span>
  p <span class="hl sym">=</span> <span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;-&quot;</span><span class="hl sym">),</span> <span class="hl kwd">make_func</span><span class="hl sym">(</span>fminus<span class="hl sym">)),</span> p<span class="hl sym">);</span>
  p <span class="hl sym">=</span> <span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;+&quot;</span><span class="hl sym">),</span> <span class="hl kwd">make_func</span><span class="hl sym">(</span>fplus<span class="hl sym">)),</span> p<span class="hl sym">);</span>
  p <span class="hl sym">=</span> <span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">cons</span><span class="hl sym">(</span><span class="hl kwd">make_sym</span><span class="hl sym">(</span><span class="hl str">&quot;eq&quot;</span><span class="hl sym">),</span> <span class="hl kwd">make_func</span><span class="hl sym">(</span>feq<span class="hl sym">)),</span> p<span class="hl sym">);</span>

  env0 <span class="hl sym">=</span> <span class="hl kwd">cons</span><span class="hl sym">(</span>p<span class="hl sym">,</span> NULL<span class="hl sym">);</span>
  <span class="hl kwa">return</span><span class="hl sym">;</span>
<span class="hl sym">}</span>
</pre>
</body>
</html>
<!--HTML generated by highlight 2.6.14, http://www.andre-simon.de/-->
